package lei.l_存储文件;

import java.io.Serializable;

/**
 * @className: User
 * @author: xl
 * @date: 2025/7/31 20:13
 * @Version: 1.0
 * @description:
 */

public class User implements Serializable {
    private static final long serialVersionUID = 1L;
    private String name;
    private int age;

    // 必须有无参构造函数（反射需要）
    public User() {}

    public User(String name, int age) {
        this.name = name;
        this.age = age;
    }

    // Getter/Setter
    public String getName() { return name; }
    public void setName(String name) { this.name = name; }
    public int getAge() { return age; }
    public void setAge(int age) { this.age = age; }

    @Override
    public String toString() {
        return "User{name='" + name + "', age=" + age + "}";
    }
}

